package com.cmnit.analysis.controller

import java.util.Date

import com.cmnit.analysis.common.TController
import com.cmnit.analysis.service.ExTollFlowService
import com.cmnit.analysis.util.{ConfigurationManager, ServiceUtil}
import org.apache.log4j.Logger

class ExTollFlowController extends TController {
  private val logger: Logger = Logger.getLogger(this.getClass)
  private val service = new ExTollFlowService

  def controller(acctTime: String): Unit = {
    if (acctTime.length == 10)
      write2vertica(ConfigurationManager.getProperty("extollFlow.table"), service.service(acctTime))
    else
      write2vertica(ConfigurationManager.getProperty("extollFlow.table"), service.service(ServiceUtil.getAcctDateOfTwoHour(new Date)))
  }
}
